import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Mine from '../views/Mine.vue'
import Goods from '../views/Goods.vue'
import Main from '../components/Main.vue'
import Other from '../components/Other.vue'

import Detail from '../views/Detail.vue'

Vue.use(VueRouter)

const routes = [
	{
		path: '/home',
		name: 'Home',
		component: Home,
		children: [
			{
				path: 'main',
				component: Main,
			},
			{
				path: 'other',
				component: Other
			},
			{
				path: '',
				redirect: "main"
			}
		]
	},
	{
		path: '/goods',
		name: 'Goods',
		component: Goods
	},
	{
		path: '/mine',
		name: 'Mine',
		component: Mine
	},
	{
		path: '/detail',
		name: 'Detail',
		component: Detail
	},
	{
		path: '*',
		redirect: "/home"
	}
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
